package com.kwq.feign.client;


import com.kwq.common.Common;
import com.kwq.feign.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;
@Component
@FeignClient(value = "userservice")
public interface UserClient {

    @GetMapping("/user/selectAll")
    Common selectAll();

    @DeleteMapping("/user/deleteById")
    Common deleteById(Integer id);

    @PostMapping("/user/saveAll")
    Common saveAll(List<User> users);

    @PostMapping("/user/updateAll")
    Common updateAll(List<User> users);

    @PostMapping("/user/nameExit")
    Common selectIfNameExit(String name);
}

